package com.tepth.appmanageservice.protocol.bodys.ordinaryfile;

import com.tepth.appmanageservice.protocol.interfaces.ISend;
import com.tepth.appmanageservice.tools.ext.ExtToBytes;

public class RunFileResult implements ISend {
	public static final short ID = 0x0E26;

	private byte fileType; // �ļ�����
	private String md5; // MD5ֵ
	private byte runResult; // ���н��
	private byte[] data;

	public byte getFileType() {
		return this.fileType;
	}

	public void setFileType(byte fileType) {
		this.fileType = fileType;
	}

	public String getMd5() {
		return this.md5;
	}

	public void setMd5(String md5) {
		this.md5 = md5;
	}

	public byte getRunResult() {
		return this.runResult;
	}

	public void setRunResult(byte runResult) {
		this.runResult = runResult;
	}

	@Override
	public short getId() {
		return ID;
	}

	@Override
	public short getLength() {
		return (short) this.data.length;
	}

	@Override
	public byte[] getResult() {
		return this.data;
	}

	@Override
	public void load() {
		byte[][] datas = new byte[3][];
		datas[0] = ExtToBytes.fromNumber(this.fileType);
		datas[1] = ExtToBytes.fromString16(this.md5);
		datas[2] = ExtToBytes.fromNumber(this.runResult);

		this.data = ExtToBytes.fromByteArray2(datas);
	}
}